load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library")

filegroup(
    name = "package-srcs",
    srcs = glob(["**"]),
    tags = ["automanaged"],
    visibility = ["//visibility:private"],
)

filegroup(
    name = "all-srcs",
    srcs = [
        ":package-srcs",
        "//gencred/cmd/gencred:all-srcs",
        "//gencred/pkg/certificate:all-srcs",
        "//gencred/pkg/kubeconfig:all-srcs",
        "//gencred/pkg/serviceaccount:all-srcs",
        "//gencred/pkg/util:all-srcs",
    ],
    tags = ["automanaged"],
    visibility = ["//visibility:public"],
)

go_library(
    name = "go_default_library",
    srcs = ["main.go"],
    importpath = "k8s.io/test-infra/gencred",
    visibility = ["//visibility:private"],
    deps = ["//gencred/cmd/gencred:go_default_library"],
)

go_binary(
    name = "gencred",
    embed = [":go_default_library"],
    visibility = ["//visibility:public"],
)
